import matplotlib.pyplot as plt

# Methods and corresponding coefficients
methods = [
    '基准回归',
    '工具变量法 (2SLS)',
    '缩小样本区间',
    '替换为覆盖广度子指数',
    '替换为使用深度子指数',
    '替换为数字化程度子指数'
]
coefficients = [0.352, 0.364, 0.341, 0.379, 0.318, 0.229]
errors = [0.025, 0.030, 0.027, 0.033, 0.028, 0.024]

# Plot
plt.figure(figsize=(10, 5))
plt.bar(methods, coefficients, yerr=errors, capsize=5, color='#1f77b4')
plt.axhline(0, color='gray', linestyle='--', linewidth=0.8)

# Labels and title
plt.ylabel('回归系数值', fontsize=12)
plt.title('图6 稳健性检验结果', fontsize=14)
plt.xticks(rotation=30, ha='right')
plt.tight_layout()
plt.show()
